function [kinematics_final] = kinematics_mean_std(kinematics_each_trial)

% calculate mean & std
len = length(kinematics_each_trial);
%R2 = zeros(len,1);
peak = zeros(len,1);
bell_RMSe = zeros(len,1);
hand_endpoint_x = zeros(len,1);
hand_endpoint_y = zeros(len,1);
duration_time = zeros(len,1);
%shoulder_excursion = zeros(len,1);
elbow_angle = zeros(len,1);
shoulder_angle = zeros(len,1);
%trajectory_sim_Cos = zeros(len,1);
%trajectory_sim_RMSe = zeros(len,1);

for i = 1:1:len
%    R2(i,1)  = kinematics_each_trial(i).vel_gaussian_R2;
    peak(i,1) = kinematics_each_trial(i).pkvel;
    bell_RMSe(i,1) = kinematics_each_trial(i).bell_RMSe;
    bell_dtw(i,1) = kinematics_each_trial(i).bell_dtw;
    hand_endpoint_x(i,1) = kinematics_each_trial(i).hand_endpoint_x;
    hand_endpoint_y(i,1) = kinematics_each_trial(i).hand_endpoint_y;
    duration_time(i,1) = kinematics_each_trial(i).duration_time;
    shoulder_angle(i,1) =  kinematics_each_trial(i).shoulder_flextion_angle;
    elbow_angle(i,1) = kinematics_each_trial(i).elbow_flexion_angle;
%     shoulder_excursion(i,1) = kinematics_each_trial(i).acromine_excursion;
%     trajectory_sim_Cos(i,1) = kinematics_each_trial(i).Cos_sim;
%     trajectory_sim_RMSe(i,1) = kinematics_each_trial(i).RMSe;
end

% kinematics_final.handvel_gaussian_R2_mean = mean(R2);
% kinematics_final.handvel_gaussian_R2_std = std(R2);

kinematics_final.hand_peak_velocity_mean = mean(peak);
kinematics_final.hand_peak_velocity_std = std(peak);
kinematics_final.hand_peak_velocity_all = peak; 

kinematics_final.bell_error_mean = mean(bell_RMSe);
kinematics_final.bell_error_std = std(bell_RMSe);
kinematics_final.bell_error_all = bell_RMSe;

kinematics_final.bell_dtw_mean = mean(bell_dtw);
kinematics_final.bell_dtw_std = std(bell_dtw);
kinematics_final.bell_dtw_all = bell_dtw;

% calculate endpoint variability
x_mean = mean(hand_endpoint_x(:,1));
y_mean = mean(hand_endpoint_y(:,1));
hand_endpoint = sqrt((hand_endpoint_x - x_mean).^2 + (hand_endpoint_y - y_mean).^2);
kinematics_final.hand_endpoint_mean = mean(hand_endpoint);
kinematics_final.hand_endpoint_std = std(hand_endpoint);
kinematics_final.hand_endpoint_all = hand_endpoint;

kinematics_final.duration_time_mean = mean(duration_time);
kinematics_final.duration_time_std = std(duration_time);
kinematics_final.duration_time_all = duration_time;

kinematics_final.shoulder_flextion_angle_mean = mean(shoulder_angle);
kinematics_final.shoulder_flextion_angle_std = std(shoulder_angle);
kinematics_final.shoulder_flextion_angle_all = shoulder_angle;

kinematics_final.elbow_flextion_angle_mean = mean(elbow_angle);
kinematics_final.elbow_flextion_angle_std = std(elbow_angle);
kinematics_final.elbow_flextion_angle_all = elbow_angle;


% record each trial


end

